package com.example.aircraftwar.prop;

import com.example.aircraftwar.application.MainActivity;
import com.example.aircraftwar.basic.AbstractFlyingObject;
import com.example.aircraftwar.aircraft.HeroAircraft;
import com.example.aircraftwar.application.Explode;

import java.util.List;

/**
 * 道具类。
 * 也可以考虑不同效果的道具
 * @author hitsz
 */
public abstract class AbstractProp extends AbstractFlyingObject {

    public AbstractProp(int locationX, int locationY, int speedX, int speedY) {
        super(locationX, locationY, speedX, speedY);
    }

    @Override
    public void forward() {
        super.forward();
        // 判定 y 轴向下飞行出界
        if (locationY >= MainActivity.WINDOW_HEIGHT) {
            vanish();
        }
    }

    public abstract void effect(HeroAircraft heroAircraft, List<Explode> explodes) throws InterruptedException;
}
